package com.atguigu.crud.controller;

import com.atguigu.crud.bean.Msg;
import com.atguigu.crud.bean.Wuser;
import com.atguigu.crud.service.WuserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 钱包个人中心
 * @author lfy
 *
 */
@Controller
@RequestMapping("/wcenter")
public class WusercenterController {
	
	@Autowired
	private WuserService wuserService;
	
	/**
	 * 返回所有的部门信息
	 */
	@CrossOrigin
	@RequestMapping("/getusers")
	@ResponseBody
	public Msg getUsers(){
		//查询所有用户信息

		List<Wuser> list = wuserService.list();
		return Msg.success().add("depts", list);
	}

	@RequestMapping("/login")
	@ResponseBody
	public Msg login(){
		//查询所有用户信息
		List<Wuser> list = wuserService.list();
		return Msg.success().add("depts", list);
	}


}
